﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="KnownColors.aspx.cs" Inherits="EnumDataSourceControlQuickStart.KnownColors" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Register Assembly="Salient.EnumDataSourceControl20" Namespace="Salient.Web.UI.WebControls"
    TagPrefix="ss" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <link href="include/CodeStyles.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
       <h1>
            Salient.Web.UI.WebControls20</h1>
        <h2>
            EnumDataSource</h2>
        <p>
            Author: Sky Sanders - <a href="mailto:sky.sanders@gmail.com">
            sky.sanders@gmail.com</a></p>
        <h5>
            A silly example:</h5>
        <ss:EnumDataSource ID="EnumDataSource1" runat="server">
        </ss:EnumDataSource>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataMember="System.Drawing.KnownColor" DataSourceID="EnumDataSource1">
            <Columns>
                <asp:TemplateField HeaderText="System.Drawing.KnownColor">
                    <EditItemTemplate>
                    </EditItemTemplate>
                    <ItemTemplate>
                    <div style='padding:10px;width:100%;background-color:#<%# Color.FromKnownColor((System.Drawing.KnownColor)Eval("EnumValue")).ToArgb().ToString("X").Substring(2) %>'>
                    <asp:Label ID="TextBox1" runat="server" Text='<%# Eval("EnumValue") %>' BackColor="White"></asp:Label>
                    </div>
                        
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
    
        </asp:GridView>
        <br />
    </div>
    </form>
</body>
</html>
